__author__ = 'zoulida'

import QUANTAXIS as QA


def chuquan():
    from sdufe.tools.santai3.tools.tusharePro import getPro
    pro = getPro()
    df = pro.adj_factor(ts_code='', trade_date='20190718')
    #df = pro.adj_factor(ts_code='000001.SZ', trade_date='')
    print(df)
    return df

def save_chuquan_tushare():

    df = chuquan()
    from sdufe.tools.santai3.tools.mongodbFactory import getConnectionChuquan
    collection =  getConnectionChuquan()


    mydict = {"date": "2020-03-13", "state": {"santai": False}}
    x = collection.insert_one(mydict)

def save_chuquan():#作废，没有完成
    data = QA.QAFetch.QATdx.QA_fetch_get_stock_xdxr('300767')
    if '2019-03-29' in data.index:
        print('true')
    #cc = data.loc['2019-03-28']
    #print(cc)
#date                          ...
#2019-03-29         5   股本变化   ...                股本变化  300767
#2020-03-30         5   股本变化   ...                股本变化  300767
#2020-06-15         1   除权除息   ...                除权除息  300767
#2020-06-15         9  转配股上市   ...               转配股上市  300767
if __name__ == '__main__':
    save_chuquan()